package com.ls.demo.bean;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author liShan
 * @date 2019/9/4 15:14
 */
@Getter
@Setter
@ToString
public class RoomBaseInfo extends BaseInfo {

    private String boxId;
    private Long roomId;

    /**
     * 客房有无人（0=无人；1=有人）
     */
    private byte haveOne;
    /**
     * 请勿打扰（0=无效；1=有效）
     */
    private byte unDisturb;
    /**
     * 请即清理（0=无效；1=有效）
     */
    private byte clean;
    /**
     * 门状态（0=开门；1=关门）
     */
    private byte close;
    /**
     * 插卡状态（0=未插卡；1=插卡）
     */
    private byte card;
    /**
     * SOS（0=无效；1=有效）
     */
    private byte sos;
    /**
     * 授权状态：0=未永久授权；1=永久授权
     */
    private byte auth;
    /**
     * 退房状态（0=无效；1=有效）
     */
    private byte checkOut;
    /**
     * 插卡身份（0b00=客人；0b01=服务员；0b10=主管；0b11=经理。）
     */
    private short checkInType;
    /**
     * 剩余授权天数。
     */
    private short authDay;
    /**
     * 稍后状态（0=关；1=开）
     */
    private byte laterState;
    /**
     * 洗衣服务（0=无效；1=有效）
     */
    private byte laundry;
    /**
     * 触发源
     */
    private short touchSource;
    /**
     * 触发面板号
     */
    private short touchPanel;

    public RoomBaseInfo() {
    }

    private RoomBaseInfo(Builder builder) {
        this.roomId = builder.roomId;
        this.boxId = builder.boxId;
        this.haveOne = builder.haveOne;
        this.unDisturb = builder.unDisturb;
        this.clean = builder.clean;
        this.close = builder.close;
        this.card = builder.card;
        this.sos = builder.sos;
        this.auth = builder.auth;
        this.checkOut = builder.checkOut;
        this.checkInType = builder.checkInType;
        this.authDay = builder.authDay;
        this.laterState = builder.laterState;
        this.laundry = builder.laundry;
        this.touchSource = builder.touchSource;
        this.touchPanel = builder.touchPanel;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder extends BaseBuilder<Builder>{

        private String boxId;
        private Long roomId;
        private byte haveOne;
        private byte unDisturb;
        private byte clean;
        private byte close;
        private byte card;
        private byte sos;
        private byte auth;
        private byte checkOut;
        private short checkInType;
        private short authDay;
        private byte laterState;
        private byte laundry;
        private short touchSource;
        private short touchPanel;

        @Override
        Builder self() {
            return this;
        }

        public Builder boxId(String boxId){
            this.boxId = boxId;
            return this;
        }

        public Builder roomId(Long roomId){
            this.roomId = roomId;
            return this;
        }

        public Builder haveOne(byte haveOne){
            this.haveOne = haveOne;
            return this;
        }

        public Builder unDisturb(byte unDisturb){
            this.unDisturb = unDisturb;
            return this;
        }

        public Builder clean(byte clean){
            this.clean = clean;
            return this;
        }

        public Builder close(byte close){
            this.close = close;
            return this;
        }

        public Builder card(byte card){
            this.card = card;
            return this;
        }

        public Builder sos(byte sos){
            this.sos = sos;
            return this;
        }

        public Builder auth(byte auth){
            this.auth = auth;
            return this;
        }

        public Builder checkOut(byte checkOut){
            this.checkOut = checkOut;
            return this;
        }

        public Builder checkInType(short checkInType){
            this.checkInType = checkInType;
            return this;
        }

        public Builder authDay(short authDay){
            this.authDay = authDay;
            return this;
        }

        public Builder laterState(byte laterState){
            this.laterState = laterState;
            return this;
        }

        public Builder laundry(byte laundry){
            this.laundry = laundry;
            return this;
        }

        public Builder touchSource(short touchSource){
            this.touchSource = touchSource;
            return this;
        }

        public Builder touchPanel(short touchPanel){
            this.touchPanel = touchPanel;
            return this;
        }

        public RoomBaseInfo build() {
            return new RoomBaseInfo(this);
        }

    }

}
